/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.acionista.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 *
 * @author joao
 */
@Embeddable
public class ClienteParticipacaoPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_cliente", nullable = false)
    private int idCliente;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dat_partic", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date datPartic;

    public ClienteParticipacaoPK() {
    }

    public ClienteParticipacaoPK(int idCliente, Date datPartic) {
        this.idCliente = idCliente;
        this.datPartic = datPartic;
    }

    public int getIdCliente() {
        return idCliente;
    }

    public void setIdCliente(int idCliente) {
        this.idCliente = idCliente;
    }

    public Date getDatPartic() {
        return datPartic;
    }

    public void setDatPartic(Date datPartic) {
        this.datPartic = datPartic;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idCliente;
        hash += (datPartic != null ? datPartic.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ClienteParticipacaoPK)) {
            return false;
        }
        ClienteParticipacaoPK other = (ClienteParticipacaoPK) object;
        if (this.idCliente != other.idCliente) {
            return false;
        }
        if ((this.datPartic == null && other.datPartic != null) || (this.datPartic != null && !this.datPartic.equals(other.datPartic))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.acionista.entity.ClienteParticipacaoPK[ idCliente=" + idCliente + ", datPartic=" + datPartic + " ]";
    }
    
}
